import vueRouter from 'vue-router';
import vue from 'vue/dist/vue.js'
vue.use(vueRouter);

const routes = [
    { 
        path: '',
        component:resolve => require(['../index.vue'],resolve),
        redirect:'/agent/index',
        children:[
          { 
            path: '/dashboard/index',
            name:'dashboard_index',
            component:resolve => require(['../page/DASHBOARD/index.vue'],resolve),
          },
          { 
            path: '/agent/index',
            name:'agent_index',
            component:resolve => require(['../page/AGENT/index.vue'],resolve),
          },
          { 
            path: '/mycruise/index',
            name:'mycruise_index',
            component:resolve => require(['../page/MYCRUISE/index.vue'],resolve),
          },
          { 
            path: '/help/index',
            name:'help_index',
            component:resolve => require(['../page/HELP/index.vue'],resolve),
          }
        ]
    },
    {//404页面
        path: '*',
        component:{
            default: '',
            template:"<div>I'm sorry I didn't find this page</div>"
        }
    }
];
const router = new vueRouter({
    base:'/',
    // mode:'history',
    routes: routes
});

export default router;